<?php
require '../config.php';
$resultset = mysql_query("select idformaspago,descripcion from formaspago",$conexion);
if(!$resultset)
{
    mysql_close();
    echo json_encode('error en el query: ' . mysql_error());
}
elseif(!mysql_num_rows($resultset))
{
    mysql_close();
    echo json_encode('Sin resultados');
}
else
{
		
			
			echo   "<table class='table table-bordered'>";
			echo   "<tr>";
			echo   "<th>Forma de pago</th><th>Selecci&oacute;n</th>";
			echo   "</tr>";
			echo   "<tbody>";
			$aux=0;
			while($row = mysql_fetch_assoc($resultset))
			{
				if($aux==0){
					$color="#FFFFFF";
					$aux=1;
				}else{
					$color="#F9F9F9";
					$aux=0;
				}
				echo ("<tr bgcolor='".$color."'>");
				echo   "<td>".$row['descripcion']."</td>";
				echo   "<td><input type='radio' name='formas' id ='".$row['idformaspago']."'></td>";
				echo   "</tr>";
			}
			
			echo   "</tbody>";
			echo   "</table>";
			mysql_close();
		
}

?>